#ifndef ATROPOS_STATE_H
#define ATROPOS_STATE_H

#include <string>
#include "util.h"

using namespace std;

typedef enum
{
	none = 0,
	incorrect,
	correct_untimely,
	correct_timely,
	out_of_bounds,
	tracker_hit,
	expert,

	num_rewards
} RewardType;

class State
{
public:
	uint64_t pc;
	uint64_t address;
	uint64_t page;
	uint32_t offset;
	int32_t	 delta;
	int16_t  region;
	uint32_t local_delta_sig;
	uint32_t local_delta_sig2;
	uint32_t local_pc_sig;
	uint32_t local_offset_sig;
	uint8_t  bw_level;
	bool     is_high_bw;
	uint32_t acc_level;

	/* 
	 * Add more states here
	 */

	void reset()
	{
		pc = 0xdeadbeef;
		address = 0xdeadbeef;
		page = 0xdeadbeef;
		offset = 0;
		delta = 0;
        region = 0;
		local_delta_sig = 0;
		local_delta_sig2 = 0;
		local_pc_sig = 0;
		local_offset_sig = 0;
		bw_level = 0;
		is_high_bw = false;
		acc_level = 0;
	}
	State(){reset();}
	~State(){}
	uint32_t value(); /* apply as many state types as you want */
	uint32_t get_hash(uint64_t value); /* play wild with hashes */
	string to_string();
};

#endif /* ATROPOS_STATE_H */
